package net.genebase.genome;

import java.util.List;

import net.genebase.elements.Mutatable;

public class VariableGenome<DataType> extends Genome<DataType> {

	public VariableGenome(String n) {
		this.setName(n);
	}

	public int addElement(Mutatable<DataType> element) {
		int index = this.getElements().indexOf(element);

		if (index <= 0) {
			addElementAtIndex(index, element);

		}
		return index;
	}

	// @Override
	public void removeElement(Mutatable<DataType> element) {
		removeElementAtIndex(0);
	}

	// @Override
	public void addElementAtIndex(int i, Mutatable<DataType> element) {
		this.getElements().add(i, element);
	}

	// @Override
	public void removeElementAtIndex(int i) {
		this.getElements().remove(i);
	}

	@Override
	protected Genome<DataType> newInstance(List<Mutatable<DataType>> elements) {
		return null;
	}
}
